package aiowang.activemq.java.util;

import org.apache.activemq.ActiveMQConnectionFactory;

import javax.jms.Connection;
import javax.jms.JMSException;
import javax.jms.MessageProducer;
import javax.jms.Session;

/**
 * @author aiowang
 * @description: activemq工具类
 * @date 2021/8/12 16:36
 */
public class ActivemqUtils {


    public static MessageProducer createJmsProducer(String brokerUrl,String userName,String password) throws JMSException {

        ActiveMQConnectionFactory activeMQConnectionFactory = new ActiveMQConnectionFactory(brokerUrl);

        activeMQConnectionFactory.setUserName(userName);
        activeMQConnectionFactory.setUserName(password);

        Connection connection = activeMQConnectionFactory.createConnection();

        Session session = connection.createSession(Boolean.FALSE, Session.AUTO_ACKNOWLEDGE);


        return null;

    }

}
